package com.yxt.service;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.yxt.data.MessageMapper;
import com.yxt.model.ChatHis;

@Service
public class MessageService {
	@Autowired
	private MessageMapper messageMapper;
	
	public List<ChatHis> getNewMsgList(Map<String,Object> params) {
		return messageMapper.getNewMsgList(params);
	}
	
	public List<ChatHis> getAllMsgList(Map<String,Object> params) {
		return messageMapper.getAllMsgList(params);
	}
	
	public void insertMsg(Map<String,Object> params) {
		messageMapper.insertMsg(params);
	}
	public void updateChatHis(int chat_id, String text) {
		Map<String,Object> p = new HashMap<String,Object>();
		p.put("chat_id", chat_id);
		p.put("text", text);
		messageMapper.updateChatHis(p);
	}
	public void deleteChatHis(int chat_id) {
		Map<String,Object> p = new HashMap<String,Object>();
		p.put("chat_id", chat_id);
		messageMapper.deleteChatHis(p);
	}
}
